package com.dahua.messagesyncsh.controller;


import com.dahua.messagesyncsh.common.result.ResultVO;
import com.dahua.messagesyncsh.pojo.EquipmentInfo;
import com.dahua.messagesyncsh.service.RedisService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
@RestController
@RequestMapping("/redis")
public class RedisController {
    @Resource
    private RedisService redisService;

    @PostMapping("/enquireEquipmentData")
    public ResultVO<?> enquireEquipmentData(@RequestBody EquipmentInfo info){
        if (info.getName() == null){
            throw new RuntimeException("请求参数错误,设备名称不能为空");
        }
        return new ResultVO<>(redisService.enquireEquipmentData(info));
    }
}
